3.1079 \(\int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx\)

Optimal. Leaf size=107 \[ \frac{i a d (c-i d)^2 \tan (e+f x)}{f}+\frac{i a (c+d \tan (e+f x))^3}{3 f}+\frac{a (d+i c) (c+d \tan (e+f x))^2}{2 f}+\frac{a (d+i c)^3 \log (\cos (e+f x))}{f}+a x (c-i d)^3 \]

[Out]

a*(c - I*d)^3*x + (a*(I*c + d)^3*Log[Cos[e + f*x]])/f + (I*a*(c - I*d)^2*d*Tan[e + f*x])/f + (a*(I*c + d)*(c +
 d*Tan[e + f*x])^2)/(2*f) + ((I/3)*a*(c + d*Tan[e + f*x])^3)/f

________________________________________________________________________________________

Rubi [A]  time = 0.13094, antiderivative size = 107, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {3528, 3525, 3475} \[ \frac{i a d (c-i d)^2 \tan (e+f x)}{f}+\frac{i a (c+d \tan (e+f x))^3}{3 f}+\frac{a (d+i c) (c+d \tan (e+f x))^2}{2 f}+\frac{a (d+i c)^3 \log (\cos (e+f x))}{f}+a x (c-i d)^3 \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])^3,x]

[Out]

a*(c - I*d)^3*x + (a*(I*c + d)^3*Log[Cos[e + f*x]])/f + (I*a*(c - I*d)^2*d*Tan[e + f*x])/f + (a*(I*c + d)*(c +
 d*Tan[e + f*x])^2)/(2*f) + ((I/3)*a*(c + d*Tan[e + f*x])^3)/f

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx &=\frac{i a (c+d \tan (e+f x))^3}{3 f}+\int (c+d \tan (e+f x))^2 (a (c-i d)+a (i c+d) \tan (e+f x)) \, dx\\ &=\frac{a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac{i a (c+d \tan (e+f x))^3}{3 f}+\int \left (a (c-i d)^2+i a (c-i d)^2 \tan (e+f x)\right ) (c+d \tan (e+f x)) \, dx\\ &=a (c-i d)^3 x+\frac{i a (c-i d)^2 d \tan (e+f x)}{f}+\frac{a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac{i a (c+d \tan (e+f x))^3}{3 f}-\left (a (i c+d)^3\right ) \int \tan (e+f x) \, dx\\ &=a (c-i d)^3 x+\frac{a (i c+d)^3 \log (\cos (e+f x))}{f}+\frac{i a (c-i d)^2 d \tan (e+f x)}{f}+\frac{a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac{i a (c+d \tan (e+f x))^3}{3 f}\\ \end{align*}

Mathematica [B]  time = 3.87655, size = 219, normalized size = 2.05 \[ \frac{(\cos (f x)-i \sin (f x)) (a+i a \tan (e+f x)) \left (-2 d \left (-9 c^2+9 i c d+4 d^2\right ) (\tan (e)+i) \sin (f x)+d^2 \cos (e) (\tan (e)+i) (9 c+2 d \tan (e)-3 i d) \sec (e+f x)+12 f x (c-i d)^3 (\cos (e)-i \sin (e)) \cos (e+f x)-3 i (c-i d)^3 (\cos (e)-i \sin (e)) \cos (e+f x) \log \left (\cos ^2(e+f x)\right )-6 (c-i d)^3 (\cos (e)-i \sin (e)) \cos (e+f x) \tan ^{-1}(\tan (2 e+f x))+2 d^3 (\tan (e)+i) \sin (f x) \sec ^2(e+f x)\right )}{6 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])^3,x]

[Out]

((Cos[f*x] - I*Sin[f*x])*(12*(c - I*d)^3*f*x*Cos[e + f*x]*(Cos[e] - I*Sin[e]) - 6*(c - I*d)^3*ArcTan[Tan[2*e +
 f*x]]*Cos[e + f*x]*(Cos[e] - I*Sin[e]) - (3*I)*(c - I*d)^3*Cos[e + f*x]*Log[Cos[e + f*x]^2]*(Cos[e] - I*Sin[e
]) - 2*d*(-9*c^2 + (9*I)*c*d + 4*d^2)*Sin[f*x]*(I + Tan[e]) + 2*d^3*Sec[e + f*x]^2*Sin[f*x]*(I + Tan[e]) + d^2
*Cos[e]*Sec[e + f*x]*(I + Tan[e])*(9*c - (3*I)*d + 2*d*Tan[e]))*(a + I*a*Tan[e + f*x]))/(6*f)

________________________________________________________________________________________

Maple [B]  time = 0.006, size = 256, normalized size = 2.4 \begin{align*}{\frac{{\frac{i}{3}}a{d}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{f}}+{\frac{{\frac{3\,i}{2}}a \left ( \tan \left ( fx+e \right ) \right ) ^{2}c{d}^{2}}{f}}+{\frac{3\,ia{c}^{2}d\tan \left ( fx+e \right ) }{f}}-{\frac{ia{d}^{3}\tan \left ( fx+e \right ) }{f}}+{\frac{a \left ( \tan \left ( fx+e \right ) \right ) ^{2}{d}^{3}}{2\,f}}+3\,{\frac{ac\tan \left ( fx+e \right ){d}^{2}}{f}}-{\frac{{\frac{3\,i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) c{d}^{2}}{f}}-{\frac{a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){d}^{3}}{2\,f}}+{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){c}^{3}}{f}}+{\frac{3\,a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){c}^{2}d}{2\,f}}-{\frac{3\,ia\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{2}d}{f}}+{\frac{ia\arctan \left ( \tan \left ( fx+e \right ) \right ){d}^{3}}{f}}+{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{3}}{f}}-3\,{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ) c{d}^{2}}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))^3,x)

[Out]

1/3*I/f*a*d^3*tan(f*x+e)^3+3/2*I/f*a*tan(f*x+e)^2*c*d^2+3*I/f*a*c^2*d*tan(f*x+e)-I/f*a*d^3*tan(f*x+e)+1/2/f*a*
tan(f*x+e)^2*d^3+3/f*a*tan(f*x+e)*c*d^2-3/2*I/f*a*ln(1+tan(f*x+e)^2)*c*d^2-1/2/f*a*ln(1+tan(f*x+e)^2)*d^3+1/2*
I/f*a*ln(1+tan(f*x+e)^2)*c^3+3/2/f*a*ln(1+tan(f*x+e)^2)*c^2*d-3*I/f*a*arctan(tan(f*x+e))*c^2*d+I/f*a*arctan(ta
n(f*x+e))*d^3+1/f*a*arctan(tan(f*x+e))*c^3-3/f*a*arctan(tan(f*x+e))*c*d^2

________________________________________________________________________________________

Maxima [A]  time = 1.50225, size = 196, normalized size = 1.83 \begin{align*} -\frac{-2 i \, a d^{3} \tan \left (f x + e\right )^{3} + 3 \,{\left (-3 i \, a c d^{2} - a d^{3}\right )} \tan \left (f x + e\right )^{2} - 6 \,{\left (a c^{3} - 3 i \, a c^{2} d - 3 \, a c d^{2} + i \, a d^{3}\right )}{\left (f x + e\right )} + 3 \,{\left (-i \, a c^{3} - 3 \, a c^{2} d + 3 i \, a c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) -{\left (18 i \, a c^{2} d + 18 \, a c d^{2} - 6 i \, a d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

-1/6*(-2*I*a*d^3*tan(f*x + e)^3 + 3*(-3*I*a*c*d^2 - a*d^3)*tan(f*x + e)^2 - 6*(a*c^3 - 3*I*a*c^2*d - 3*a*c*d^2
 + I*a*d^3)*(f*x + e) + 3*(-I*a*c^3 - 3*a*c^2*d + 3*I*a*c*d^2 + a*d^3)*log(tan(f*x + e)^2 + 1) - (18*I*a*c^2*d
 + 18*a*c*d^2 - 6*I*a*d^3)*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [B]  time = 1.59514, size = 733, normalized size = 6.85 \begin{align*} -\frac{18 \, a c^{2} d - 18 i \, a c d^{2} - 8 \, a d^{3} +{\left (18 \, a c^{2} d - 36 i \, a c d^{2} - 18 \, a d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (36 \, a c^{2} d - 54 i \, a c d^{2} - 18 \, a d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} -{\left (-3 i \, a c^{3} - 9 \, a c^{2} d + 9 i \, a c d^{2} + 3 \, a d^{3} +{\left (-3 i \, a c^{3} - 9 \, a c^{2} d + 9 i \, a c d^{2} + 3 \, a d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (-9 i \, a c^{3} - 27 \, a c^{2} d + 27 i \, a c d^{2} + 9 \, a d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (-9 i \, a c^{3} - 27 \, a c^{2} d + 27 i \, a c d^{2} + 9 \, a d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{3 \,{\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-1/3*(18*a*c^2*d - 18*I*a*c*d^2 - 8*a*d^3 + (18*a*c^2*d - 36*I*a*c*d^2 - 18*a*d^3)*e^(4*I*f*x + 4*I*e) + (36*a
*c^2*d - 54*I*a*c*d^2 - 18*a*d^3)*e^(2*I*f*x + 2*I*e) - (-3*I*a*c^3 - 9*a*c^2*d + 9*I*a*c*d^2 + 3*a*d^3 + (-3*
I*a*c^3 - 9*a*c^2*d + 9*I*a*c*d^2 + 3*a*d^3)*e^(6*I*f*x + 6*I*e) + (-9*I*a*c^3 - 27*a*c^2*d + 27*I*a*c*d^2 + 9
*a*d^3)*e^(4*I*f*x + 4*I*e) + (-9*I*a*c^3 - 27*a*c^2*d + 27*I*a*c*d^2 + 9*a*d^3)*e^(2*I*f*x + 2*I*e))*log(e^(2
*I*f*x + 2*I*e) + 1))/(f*e^(6*I*f*x + 6*I*e) + 3*f*e^(4*I*f*x + 4*I*e) + 3*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [B]  time = 9.55182, size = 218, normalized size = 2.04 \begin{align*} \frac{a \left (- i c^{3} - 3 c^{2} d + 3 i c d^{2} + d^{3}\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac{- \frac{\left (6 a c^{2} d - 12 i a c d^{2} - 6 a d^{3}\right ) e^{- 2 i e} e^{4 i f x}}{f} - \frac{\left (12 a c^{2} d - 18 i a c d^{2} - 6 a d^{3}\right ) e^{- 4 i e} e^{2 i f x}}{f} - \frac{\left (18 a c^{2} d - 18 i a c d^{2} - 8 a d^{3}\right ) e^{- 6 i e}}{3 f}}{e^{6 i f x} + 3 e^{- 2 i e} e^{4 i f x} + 3 e^{- 4 i e} e^{2 i f x} + e^{- 6 i e}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))**3,x)

[Out]

a*(-I*c**3 - 3*c**2*d + 3*I*c*d**2 + d**3)*log(exp(2*I*f*x) + exp(-2*I*e))/f + (-(6*a*c**2*d - 12*I*a*c*d**2 -
 6*a*d**3)*exp(-2*I*e)*exp(4*I*f*x)/f - (12*a*c**2*d - 18*I*a*c*d**2 - 6*a*d**3)*exp(-4*I*e)*exp(2*I*f*x)/f -
(18*a*c**2*d - 18*I*a*c*d**2 - 8*a*d**3)*exp(-6*I*e)/(3*f))/(exp(6*I*f*x) + 3*exp(-2*I*e)*exp(4*I*f*x) + 3*exp
(-4*I*e)*exp(2*I*f*x) + exp(-6*I*e))

________________________________________________________________________________________

Giac [B]  time = 1.99834, size = 806, normalized size = 7.53 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/3*(-3*I*a*c^3*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 9*a*c^2*d*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*
x + 2*I*e) + 1) + 9*I*a*c*d^2*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 3*a*d^3*e^(6*I*f*x + 6*I*e)*l
og(e^(2*I*f*x + 2*I*e) + 1) - 9*I*a*c^3*e^(4*I*f*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 27*a*c^2*d*e^(4*I*f
*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 27*I*a*c*d^2*e^(4*I*f*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 9*a
*d^3*e^(4*I*f*x + 4*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 9*I*a*c^3*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e)
+ 1) - 27*a*c^2*d*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) + 27*I*a*c*d^2*e^(2*I*f*x + 2*I*e)*log(e^(2
*I*f*x + 2*I*e) + 1) + 9*a*d^3*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 18*a*c^2*d*e^(4*I*f*x + 4*I*
e) + 36*I*a*c*d^2*e^(4*I*f*x + 4*I*e) + 18*a*d^3*e^(4*I*f*x + 4*I*e) - 36*a*c^2*d*e^(2*I*f*x + 2*I*e) + 54*I*a
*c*d^2*e^(2*I*f*x + 2*I*e) + 18*a*d^3*e^(2*I*f*x + 2*I*e) - 3*I*a*c^3*log(e^(2*I*f*x + 2*I*e) + 1) - 9*a*c^2*d
*log(e^(2*I*f*x + 2*I*e) + 1) + 9*I*a*c*d^2*log(e^(2*I*f*x + 2*I*e) + 1) + 3*a*d^3*log(e^(2*I*f*x + 2*I*e) + 1
) - 18*a*c^2*d + 18*I*a*c*d^2 + 8*a*d^3)/(f*e^(6*I*f*x + 6*I*e) + 3*f*e^(4*I*f*x + 4*I*e) + 3*f*e^(2*I*f*x + 2
*I*e) + f)